package com.zhongge.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName Main
 * @Description TODO
 * @Author zhongge
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        //获取IOC容器
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");

        //从IOC容器中获取对象
        Object student1 = applicationContext.getBean("student1");
        System.out.println(student1);
        Object address1 = applicationContext.getBean("address1");
        System.out.println(address1);
    }
}
